CompressPicture
TheCompressPicture
function compresses a single-frame image stored as a picture structure and places the result in another picture. If a picture with multiple pixel
maps and other graphical objects is passed, the pixel maps will be compressed individually and the other graphic objects will not be affected.
pascal OSErr CompressPicture (PicHandle srcPicture, PicHandle dstPicture, CodecQ quality, CodecType cType);
srcPicture
- Contains a handle to the source image, stored as a picture.
dstPicture
- Contains a handle to the destination for the compressed image. The compressor resizes this handle for the result data.
quality
- Specifies the desired compressed image quality. See "Compression Quality Constants" beginning on page 3-57 for valid values.
cType
- Specifies a compressor type. You must set this parameter to a
valid compressor type (see Table 3-3 on page 3-64 for a list of the available compressor types). If the value passed in is 0, or'raw '
, and the source picture is compressed, the destination picture is created as an uncompressed picture and does not require QuickTime to be displayed.DESCRIPTION
TheCompressPicture
function compresses only image data. Any other types of data in the picture, such as text, graphics primitives, and previously compressed images, are not modified in any way and are passed through to the destination picture.This function does not use the graphics port.
If your picture does not fit in memory, use the
CompressPictureFile
function, which is described on page 3-88.This function supports parameters governing image quality and compressor type. The compressor infers the other compression parameters from the image data in the source picture.
SPECIAL CONSIDERATIONS
TheCompressPicture
function doesn't compress pictures that contain compressed data. Do not alter data in pictures that are already compressed. Instead useFCompressPicture
, described in the next section.RESULT CODES
noErr 0 No error paramErr -50 Invalid parameter specified memFullErr -108 Not enough memory available noCodecErr -8961 The Image Compression Manager could not find the specified compressor SEE ALSO
If you need more control over the compression operation than is provided by theCompressPicture
function, use theFCompressPicture
function.